﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Products.aspx.cs" Inherits="TicketM.Configuration.Products" MasterPageFile="./ConfigSite.Master"%>

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>Ticketing Application Configuration Manager</h1>
            </hgroup>
              <nav>
                    <ul id="lmenu">
                        <li><a id="A1" runat="server" href="Configuration.aspx">Servers and Accounts</a></li>
                        <li><a id="A2" runat="server" href="Routing.aspx">Conditional Assignment</a></li>
                        <li><a id="A3" runat="server" href="#"><span style="color: darkslategray">Products List</span></a></li>
                        <li><a id="A4" runat="server" href="Escalation.aspx">Escalation</a></li>
                    </ul>
                </nav>
        </div>
    </section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    <table>
    <tr>
        <td style="border-right:ridge;border-right-color:darkgrey">
            <h3><asp:Label runat="server" ID="lblProject" Text="" /></h3>
            <asp:DataList ID="DataList1" runat="server" DataSourceID="ProductsDataSource" Width="200px">
                <HeaderTemplate>
                    <asp:Label Text="Existing Products" style="text-decoration:underline;font-size:large" runat="server"/>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text="<%# Container.DataItem %>" />
                </ItemTemplate>
    </asp:DataList>
            <asp:ObjectDataSource ID="ProductsDataSource" runat="server" SelectMethod="GetProductsList" TypeName="TicketM.Models.Tickets">
                <SelectParameters>
                    <asp:SessionParameter SessionField="sProject" Name="sProject" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </td>
        <td style="width:20px"></td>
        <td style="vertical-align:top">
            <asp:Label runat="server" Text="Enter a new product name to add:" /><br/>
            <asp:TextBox runat="server" ID="NewProduct" />
            <asp:Button runat="server" ID="AddNewProductButton" Text="Add New Product" OnClick="AddNewProductButton_Click" /><br />
            <asp:Label runat="server" ID="Result" />
            <asp:RequiredFieldValidator ControlToValidate="NewProduct" ErrorMessage="New product name is required" runat="server" ForeColor="Red" />
        </td>
    </tr>
   </table>
    
</asp:Content>